package com.example.module_home.model.service

import com.example.lib_net.RetrofitFactory
import com.example.lib_net.entity.ResponseEntity
import com.example.module_home.model.api.VideoTypeApi
import com.ivideo.home.model.entity.MutilTypeEntity
import com.ivideo.home.model.entity.SimpleTypeEntity
import retrofit2.http.Query

/**
 * @author yaotianxue
 * @description
 * @date 2024/10/24
 */
class VideoTypeService {
    var api: VideoTypeApi

    init {
        api= RetrofitFactory.getRetrofitFactory().create(VideoTypeApi::class.java)
    }

    /**
     * 获取视频类型信息
     */
    suspend fun getSimpleType(): ResponseEntity<List<SimpleTypeEntity>> {
        return api.getSimpleType()
    }

    /**
     * 获取多级视频类型信息
     */
    suspend fun getMutilType(): ResponseEntity<List<MutilTypeEntity>>{
        return api.getMutilType()
    }

    /**
     * 根据上级id获取类型视频信息
     */
    suspend fun getMutilTypeByPid(@Query("pid") pid:Int): ResponseEntity<List<MutilTypeEntity>>{
        return api.getMutilTypeByPid(pid)
    }
}